#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const double C=0.5772156649015328606;
int main(void){
    int t;
    int n;
    scanf("%d",&t);
    int c=1;
    while(t--){
        scanf("%d",&n);
        double ans=0;
        if(n<1000000){
            for(int i=1;i<=n;i++){
                ans+=1.0/i;
            }
        }
        else{
            ans=log((double)n)+C+1.0/(2*n);
        }
        printf("Case %d: %.10lf\n",c++,ans);
    }
    return 0;
}
